<template lang="html">
  <section class="channel-h5 top-home">
    <div class="channel-h5__header">
        <p class="channel-h5__title">
            本周最火
        </p>
    </div>
    <ul class="list-h5">
        <li v-for="item in lists"  @click="toBook(item.id)">
            <div class="book-h5">
                <div class="book-h5__cover">
                    <img  :src="item.cover">
                    <p class="book-h5__finish">完结</p>
                </div>
                <div class="book-h5__info">
                    <p class="book-h5__title">{{item.title}}</p>
                    <p class="book-h5__author">{{item.authors}}</p>
                    <p class="book-h5__summary">{{item.summary}}</p>
                    <div class="book-h5__wrap">
                        <div class="book-h5__tag" v-for="tag in item.tags" >{{tag}}</div>
                    </div>
                </div>
            </div>
        </li>
    </ul>
  </section>
</template>

<script>
export default {
  // props:{
  //   lists:[]
  // },
  data(){
    return {
      lists:[]
    }
  },
  methods:{
    toBook(id){
      this.$router.push({path:'/book/'+id});
    }
  },
  mounted(){
    this.axios('http://localhost:4000/data/index').then((res) => {
      this.lists = res.data.items[1].data.data;
    });
  }
}
</script>

<style lang="css" scoped>
  .channel-h5 {
      background: #fff;
      border-bottom: 10 solid #f5f5f5;
      position: relative;
  }
  .channel-h5__header {
    padding: 15px 13px 14px 13px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
  }
  .channel-h5__title {
    position: relative;
    font: bold 13px/13px a;
    color: rgba(0,0,0,0.9);
  }
  .list-h5 {
    padding: 0 13px;
}
.list-h5 li {
    padding: 17px 0;
    border-bottom: 1px solid #f0f0f0;
}
.book-h5 {
    overflow: hidden;
    cursor: pointer;
}
.book-h5__cover {
    float: left;
    position: relative;
    width: 85px;
    height: 113px;
    background-color: #eeece9;
    border: 1px solid #f0f0f0;
    border-radius: 1px;
    overflow: hidden;
}
.book-h5 img {
    width: 100%;
    height: 100%;
    border-radius: 1px;
}
.book-h5__finish {
    position: absolute;
    bottom: 0px;
    width: 100%;
    color: #fff;
    padding: 25px 7px 2px;
    background: -webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.3));
}
.book-h5 .book-h5__info {
    margin-left: 100px;
    padding-top: 6px;
    background: #fff;
}
.book-h5__title {
    margin-bottom: 4px;
    font: 16px/17px a;
    color: rgba(0,0,0,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-h5__author {
    margin-top: 8px;
    font: 12px/12px a;
    color: rgba(0,0,0,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-h5__summary {
    margin: 8px 0 0;
    height: 2.8em;
    font: 12px/1.4em a;
    color: rgba(0,0,0,0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.book-h5__wrap {
    margin: 10px;
    padding-top: 3px;
    overflow: hidden;
}
.book-h5__tag {
    float: left;
    margin: -3px 7px 5px 0;
    padding: 3px 6px 2px;
    max-width: 6em;
    font: 10px/11px a;
    color: #e53e0d;
    border: 1px solid #e53e0d;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
</style>
